package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.MeterLog;
import jtk.project4.fleet.domain.Vendor;
import jtk.project4.fleet.domain.VendorType;




public class MeterLogDao extends IbatisDao{
	
	public List selectMeterLog() throws SQLException {
		List selectMeterLog = null;
			selectMeterLog =getSqlMap().queryForList("SELECT_ALL_meter_log", null);
		return selectMeterLog;
	}

	public int deleteMeterLog(MeterLog meterLog) throws SQLException{
		return (int) getSqlMap().delete("DELETE_meter_log", meterLog);
	}
	
	public int updateMeterLog(MeterLog meterLog) throws SQLException{
		return (int) getSqlMap().update("UPDATE_meter_log", meterLog);
	}
	
	public MeterLog insertMeterLog(MeterLog meterLog) throws SQLException{
		return (MeterLog) getSqlMap().insert("INSERT_meter_log", meterLog);
	}

	
		
	public static void main (String args[]) throws SQLException{
		MeterLog meterlog;
		meterlog = new MeterLog();
		meterlog.setSource("Coba dari Main");
		meterlog.setObjectId(123);
		new MeterLogDao().insertMeterLog(meterlog);
		
		}
	
}